-- CALC_BINE_HP

-- 计算魔藤当前血量
-- @param bine    魔藤
return function(bine, fix)
    local hp = bine.dbase:query("hp", 0);

    -- 加成
    local prop = PropM.combine(bine, "attrib2", "max_hp");
    hp = PropM.apply(prop, hp);

    -- 玩家对召唤兽属性加成
    local baseHp = FormulaM.invoke("BINE_BASE_HP", bine:getLevel());
    local addon_hp = FormulaM.invoke("SUMMON_ATTRIB_ADDITION", bine, baseHp, "max_hp");

    hp = hp + addon_hp;

    -- 所有召唤物能力加
    prop = PropM.combine(ME.user, "summon_attrib", "hp");
    hp = PropM.apply(prop, hp);

    if fix then
        hp = iif(hp < 0, 0, hp);
    end

    return hp;
end
